<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <title>员工面板</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

    <script src="../../scripts/boot.js" type="text/javascript"></script>



    <style type="text/css">
        .asLabel .mini-textbox-border,
        .asLabel .mini-textbox-input,
        .asLabel .mini-buttonedit-border,
        .asLabel .mini-buttonedit-input,
        .asLabel .mini-textboxlist-border {
            border: 0;
            background: none;
            cursor: default;
        }

        .asLabel .mini-buttonedit-button,
        .asLabel .mini-textboxlist-close {
            display: none;
        }

        .asLabel .mini-textboxlist-item {
            padding-right: 8px;
        }
    </style>
    </style>
</head>

<body>

    <form id="form1" method="post">
        <input name="id" class="mini-hidden" />
        <fieldset style="border:solid 1px #aaa;padding:3px;">
            <legend>新增图书信息</legend>
            <div style="padding:5px;">
                <table>
                    <tr>
                        <td style="width:80px;">图书名称</td>
                        <td style="width:150px;">
                            <input name="bookname" class="mini-textbox" required="true" emptyText="请输入图书名称" />
                        </td>
                        <td style="width:80px;">出版社：</td>
                        <td>
                            <input name="publisher" class="mini-textbox" required="true" emptyText="请输入出版社" />
                        </td>

                    </tr>
                    <tr>
                        <td>作者：</td>
                        <td>
                            <input name="author" class="mini-textbox" required="true" />
                        </td>
                        <td>图书类别：</td>
                        <td>
                            <input name="booktype" class="mini-combobox" required="true" url="../../data/book.txt"
                                showNullItem="true" nullItemText="-请选择类别-" allowInput="true" />
                        </td>
                    </tr>
                    <tr>
                        <td>剩余数量：</td>
                        <td>
                            <input name="remain" class="mini-spinner" required="true" minvalue="0" maxvalue="200"
                                increment=1 format="#,0" />
                        </td>
                        <td></td>
                        <td>

                        </td>
                    </tr>
                </table>
            </div>
        </fieldset>

    </form>
    <script type="text/javascript">
        mini.parse();


        var form = new mini.Form("form1");

        function SetData(data) {
            //跨页面传递的数据对象，克隆后才可以安全使用
            data = mini.clone(data);
            console.log(data);
            $.ajax({
                url: "../../bookinfodetailaction?method=querybookinfobyid&id=" + data.bookId,
                cache: false,
                success: function (text) {
                    var o = mini.decode(text);
                    form.setData(o.data);
                    form.setChanged(false);//设置当前表单未修改状态
                }
            });
        }


        function CloseWindow(action) {
            if (window.CloseOwnerWindow) {
                return window.CloseOwnerWindow(action);
            } else {
                window.close();
            }
        }
        labelModel();

        function labelModel() {
            var fields = form.getFields();
            for (var i = 0, l = fields.length; i < l; i++) {
                var c = fields[i];
                if (c.setReadOnly) c.setReadOnly(true);     //只读
                if (c.setIsValid) c.setIsValid(true);      //去除错误提示
                if (c.addCls) c.addCls("asLabel");          //增加asLabel外观
            }
        }




    </script>
</body>

</html>